// 移动端菜单组件样式
@use '../variables' as *;
.mobile-menu {
    display: none;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
    outline: none;
    .hamburger-line {
        width: 100%;
        height: 3px;
        background: #374151;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    &.active {
        .hamburger-line {
            &:nth-child(1) {
                transform: rotate(45deg) translate(6px, 6px);
            }
            &:nth-child(2) {
                opacity: 0;
            }
            &:nth-child(3) {
                transform: rotate(-45deg) translate(6px, -6px);
            }
        }
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all $transition-normal;
    &.active {
        opacity: 1;
        visibility: visible;
    }
}

.menu-content {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #fefefe;
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    overflow-x: hidden;
    &.active {
        right: 0;
    }
}

.menu-header {
    padding: 32px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    .user-info {
        display: flex;
        align-items: center;
        gap: 16px;
        .user-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            overflow: hidden;
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }
        .user-name {
            color: white;
            font-weight: 500;
            font-size: 1.125rem;
        }
    }
}

.mobile-nav {
    flex: 1;
    padding: $spacing-lg 0;
    overflow-y: auto;
    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: $spacing-md;
        padding: $spacing-md $spacing-xl;
        color: $text-primary;
        text-decoration: none;
        transition: all $transition-normal;
        border-left: 3px solid transparent;
        &:hover {
            background: rgba($accent-color, 0.05);
            border-left-color: $accent-color;
            color: $accent-color;
        }
        &.router-link-active {
            background: rgba($accent-color, 0.1);
            border-left-color: $accent-color;
            color: $accent-color;
        }
        .arrow {
            margin-left: auto;
            transition: transform $transition-normal;
            &.rotated {
                transform: rotate(180deg);
            }
        }
    }
    .category-submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height $transition-normal;
        &.active {
            max-height: 200px;
        }
        .submenu-link {
            display: block;
            padding: $spacing-sm $spacing-xl $spacing-sm $spacing-2xl;
            color: $text-secondary;
            text-decoration: none;
            transition: all $transition-normal;
            &:hover {
                color: $accent-color;
                background: rgba($accent-color, 0.05);
            }
            &.router-link-active {
                color: $accent-color;
                background: rgba($accent-color, 0.1);
            }
        }
    }
}

.menu-footer {
    padding: $spacing-xl;
    border-top: 1px solid $border-color;
    .mobile-search {
         :deep(.el-input__wrapper) {
            border-radius: $radius-lg;
            background: $border-light;
            border: 1px solid $border-color;
            &:hover {
                border-color: $accent-color;
            }
            &.is-focus {
                border-color: $accent-color;
                box-shadow: 0 0 0 2px rgba($accent-color, 0.1);
            }
        }
    }
}

// 响应式显示
@media (max-width: 768px) {
    .mobile-menu {
        display: block !important;
    }
    .hamburger-btn {
        display: flex !important;
        position: relative !important;
        z-index: 1001 !important;
    }
    .menu-content {
        width: 280px;
        max-width: 90vw;
        &.active {
            right: 0 !important;
        }
    }
}

@media (max-width: 480px) {
    .menu-content {
        width: 260px;
        max-width: 85vw;
    }
    .mobile-nav {
        .mobile-nav-link {
            padding: $spacing-sm $spacing-lg;
            font-size: 14px;
        }
        .submenu-link {
            padding: $spacing-xs $spacing-lg $spacing-xs $spacing-xl;
            font-size: 13px;
        }
    }
}